/*
 * @Author: dingyuwen ding_yuwen@163.com
 * @Date: 2023-01-09 16:08:49
 * @LastEditTime: 2023-02-17 21:51:23
 * @LastEditors: DingYuwen 43669762+DingYuwen@users.noreply.github.com
 * @Description:
 */
import { createStorage } from './storage';

const prefixKey = 'VITE_REACT_RTK_TOURFLY_';
interface Option {
  prefixKey?: string;
}
export const createLocalStorage = function (option: Option) {
  return createStorage({
    prefixKey: option.prefixKey || '',
    storage: 'localStorage',
  });
};

export const createSessionStorage = function (option: Option) {
  return createStorage({
    prefixKey: option.prefixKey || '',
    storage: 'sessionStorage',
  });
};

export const lStorage = createLocalStorage({ prefixKey });

export const sStorage = createSessionStorage({ prefixKey });
